package com.xinqi.modules.databank.client;

import com.xinqi.common.base.constants.ServiceNameConstants;
import com.xinqi.common.base.response.R;
import com.xinqi.modules.databank.dto.req.CourseResourceUpdateDTO;
import com.xinqi.modules.databank.dto.rsp.CourseInteractionSubmitResult;
import com.xinqi.modules.databank.dto.rsp.ResourceResponseDTO;
import com.xinqi.modules.databank.factory.CourseResourceFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;


@FeignClient(contextId = "courseResourceClient", value = ServiceNameConstants.XQ_DATABANK, fallbackFactory = CourseResourceFallbackFactory.class)
public interface CourseResourceClient {

    /**
     * 根据id查询资料详情
     *
     * @Author dzy
     * @Return
     */
    @GetMapping("/inner/base/resource/getInfo/{contentId}")
    R<ResourceResponseDTO> getResourceInfo(@PathVariable("contentId") Long contentId);

    /**
     * 修改资料信息
     *
     * @Author dzy
     * @Date 10:10 2023/3/9 0009
     * @Return
     */
    @PutMapping("/inner/base/resource/update/{id}")
    R<String> update(@PathVariable("id") Long id, @Validated @RequestBody CourseResourceUpdateDTO dto);

    /**
     * 加入班级同步资料
     *
     * @Author dzy
     * @Date 10:10 2023/3/9 0009
     * @Return
     */
    @PutMapping("/inner/base/resource/joinClass/{classId}/{studentId}")
    R<String> joinClass(@PathVariable("classId") Long classId, @PathVariable("studentId") Long studentId);

}
